<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>消费记录</title>
    <link rel="stylesheet"  href="src/css/base.css?__version=9.4">
    <link rel="stylesheet"  href="src/css/pages.css?__version=9.4">
    <script type="text/javascript" src="src/js/jquery-1.10.1.min.js?__version=9.4"></script>
    <script type="text/javascript" src="src/js/rem.js?__version=9.4"></script>
    <script type="text/javascript" src="src/js/dropload.js?__version=9.4"></script>
    <script type="text/javascript" src="src/js/init.js?__version=9.4"></script>

	<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script src="/src/js/share.js?__version=9.4"></script>
	<script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?8ed2efe5b24e14f351f4d88ba2eb3462";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
</head>
<body>
	<div class="init_content" style="display: none;">
	    <div class="warp consumerCenter-warp">
	        <section class="bill-list" id='htmlDataList'>
	        </section>
	    </div>
    </div>
    <div class="init_loading">
        <img src="src/img/page_loading.gif?v=1">
    </div>
</body>
<script>
addheader("消费记录","javascript:history.back(-1);");
dropload(".warp");
$(function () {
	checkUserLogin();
	fetchData("/OpenAPI/V1/User/consume", {token: token, page: 1}, function (data) {
		var htmlDataList = '';
		for (var i = 0; i < data.length; i++) {
			htmlDataList += '<div class="bill-item">';
			htmlDataList += '<div class="info text-beyond">';
			htmlDataList += '<span>' + data[i].content + '</span>';
			htmlDataList += '</div>';
			htmlDataList += '<p class="time">' + getLocalTime(data[i].addtime) + '</p>';
			htmlDataList += '<span class="money">' + data[i].coin_math + '金币</span>';
			htmlDataList += '</div>';
		}
		$("#htmlDataList").append(htmlDataList);
	})
})
function getLocalTime(nS) {
	return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/,' ');
}
</script>
</html>
